using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UMC.Data;

namespace UMC.Web.UI
{
    public class UISwitch : UICell
    {
        WebMeta webMeta = new WebMeta();
        public override WebMeta Data => webMeta;
        public UISwitch()
        {

            this.Type = "Switch";
        }
        public UISwitch Click(params UIClick[] click)
        {
            this.webMeta.Put("click", click);
            return this;
        }
        public UISwitch Marker(String marker)
        {

            this.webMeta.Put("marker", marker);
            return this;
        }

        public UISwitch Text(String fmt)
        {
            this.Format("text", fmt);
            return this;
        }
        public UISwitch Selected(bool value)
        {
            if (value)
            {
                this.webMeta.Put("selected", true);
            }
            else
            {
                this.webMeta.Remove("selected");
            }
            return this;
        }
    }
}